/**
 * 
 */
package com.photoinfo.test;

import java.io.FileNotFoundException;
import java.io.IOException;

import org.apache.log4j.Logger;
import org.testng.annotations.Test;

import com.photoinfo.app.PhotoInfoApp;
import com.photoinfo.app.service.SerializationService;
import com.photoinfo.app.service.SerializationServiceImpl;

/**
 * @author 	Holz, Roberto
 *			
 * created	24.04.2008 | 23:37:45
 */
public class CreateEmptyDat {
	
	protected Logger log = Logger.getLogger(this.getClass());
	
	protected PhotoInfoApp app;
	protected SerializationService serializationService;
	
	public CreateEmptyDat() {
		app = new PhotoInfoApp();
		serializationService = new SerializationServiceImpl();
	}
	
	@Test
	public void writeEmptyDat(){
		try{
			serializationService.serialize(PhotoInfoApp.DATA, app);
		}catch(FileNotFoundException nofile){
			log.error("data File not found (Error msg: "+nofile.getMessage()+")");
		}catch(IOException io){
			log.error("Can't access File (Error msg: "+io.getMessage()+")");
		}
	}
	
}
